package com.wz.project.bas.department.service;

import com.wz.common.utils.text.Convert;
import com.wz.project.bas.department.domain.Department;
import com.wz.project.bas.department.mapper.DepartmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 领用部门 服务层实现
 * 
 * @author sys
 * @date 2021-10-28
 */
@Service
public class DepartmentServiceImpl implements IDepartmentService 
{
	@Autowired
	private DepartmentMapper departmentMapper;

	/**
     * 查询领用部门信息
     * 
     * @param departmentId 领用部门ID
     * @return 领用部门信息
     */
    @Override
	public Department selectDepartmentById(String departmentId)
	{
	    return departmentMapper.selectDepartmentById(departmentId);
	}
	
	/**
     * 查询领用部门列表
     * 
     * @param department 领用部门信息
     * @return 领用部门集合
     */
	@Override
	public List<Department> selectDepartmentList(Department department)
	{
	    return departmentMapper.selectDepartmentList(department);
	}
	
    /**
     * 新增领用部门
     * 
     * @param department 领用部门信息
     * @return 结果
     */
	@Override
	public int insertDepartment(Department department)
	{
	    return departmentMapper.insertDepartment(department);
	}
	
	/**
     * 修改领用部门
     * 
     * @param department 领用部门信息
     * @return 结果
     */
	@Override
	public int updateDepartment(Department department)
	{
	    return departmentMapper.updateDepartment(department);
	}

	/**
     * 删除领用部门对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteDepartmentByIds(String ids)
	{
		return departmentMapper.deleteDepartmentByIds(Convert.toStrArray(ids));
	}
	
}
